home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8919 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.6 KB  |  37 lines

  1. Path: solon.com!not-for-mail
  2. From: seebs@solutions.solon.com (Peter Seebach)
  3. Newsgroups: comp.lang.c++,comp.lang.c
  4. Subject: Re: Performance: C vs. C++
  5. Date: 27 Feb 1996 06:39:27 -0600
  6. Organization: Usenet Fact Police (Undercover)
  7. Message-ID: <4guu1v$ie1@solutions.solon.com>
  8. References: <30F6BAAC.12B5@iastate.edu> <4frur0$73t@adam.telalink.net> <4fvr7k$a3l@stc06.ctd.ornl.gov> <4gqdo6INNsqe@keats.ugrad.cs.ubc.ca>
  9. NNTP-Posting-Host: solutions.solon.com
  10.  
  11. In article <4gqdo6INNsqe@keats.ugrad.cs.ubc.ca>,
  12. Kazimir Kylheku <c2a192@ugrad.cs.ubc.ca> wrote:
  13. >Boy, with all this obfuscation, you can almost forget that a pointer is just a
  14. >simple machine address! 
  15.  
  16. No, it's a machine address or similar tag along with a knowledge of what kind
  17. of thing it points to.  Implementations exist where the conversion from a
  18. char * to a long * is a right-shift by 2.  Although it's not complete, I
  19. have a draft for an implementation where
  20.     main() {
  21.         int i, *ip = &i;
  22.     }
  23. leaves ip looking something like "pint, 0".
  24.  
  25. (0 is not the null pointer internally in this implementation; it's used for
  26. the first object of a type.)
  27. (i is internally marked as being an int as well, so &i looks like "pint, 0",
  28. and the assignment is legal.  Assigning from most other pointer types without
  29. the required cast would generate a run-time fault.  ;))
  30.  
  31. -s
  32. -- 
  33. Peter Seebach - seebs@solon.com - Copyright 1996 Peter Seebach.
  34. C/Unix wizard -- C/Unix questions? Send mail for help.  No, really!
  35. FUCK the communications decency act.  Goddamned government.  [literally.]
  36. The *other* C FAQ - http://www.solon.com/~seebs/c/c-iaq.html
  37.